import "xyz"
import img from "../img/pic.png"


let wmm="123"
console.log(wmm);
function ajax(url,query){
    return new Promise((resolve,reject)=>{
        let xhr=new XMLHttpRequest();
        url=query?`${url}?${query}`:url;
        xhr.open("get",url,true);
        xhr.onreadystatechange=(()=>{
            if(xhr.readyState!=4){
                return;
            }
            if(xhr.status===200){
                resolve(xhr.responseText);
            }else{
                reject(new Error(error));
            }
        })
    })
}
ajax("/api/list").then((res)=>{
    console.log(res);
})